package com.bcmusic.authorization.controller;
import com.bcmusic.authorization.pojo.Authorization;
import com.bcmusic.authorization.service.AuthorizationService;
import com.bcmusic.order.pojo.OrderCart;
import com.github.pagehelper.PageInfo;
import entity.Result;
import entity.StatusCode;
import io.swagger.annotations.*;
import org.aspectj.apache.bcel.generic.RET;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/****
 * @Author:admin
 * @Description:
 * @Date 2019/6/14 0:18
 *****/
@Api(value = "AuthorizationController")
@RestController
@RequestMapping("/authorization")
@CrossOrigin
public class AuthorizationController {

    @Autowired
    private AuthorizationService authorizationService;

    @ApiOperation(value = "根据订单所对应的购物车中的商品添加", notes = "许可类型商品在商品页面调用这个接口将物品添加到购物车中")
    @PostMapping("addAuthorization")
    public Result addAuthorization(@RequestParam Integer orderId){
        Integer integer = authorizationService.addAuthorization(orderId);
        return integer==1?new Result(true,StatusCode.OK,"版权信息添加成功"): new Result(true,StatusCode.ERROR,"版权信息添加失败");
    }


}
